﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Security.Principal;

namespace Gui.Net
{
    static class Program
    {

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            DuplicateChecker dc = new DuplicateChecker(ApplicationId());
            if (dc.Check())
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
        }

        private static string applicationName = "AeroDisabler";
        private static string uniqueIdPart = "93F77CC1_77C4_4748_B869_828EE966EF74";

        private static string ApplicationId()
        {
            string userName = WindowsIdentity.GetCurrent().Name;
            userName = userName.Replace("\\", "_");
            return String.Format("{0}_{1}_{2}", applicationName, userName, uniqueIdPart);
        }
    }
}
